Skip to content

fix(pm): dispatch-gates derives the gates that load a changed scripts/pm module, transitively - #34080

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-8x8llj
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-8x8llj

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33848

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:派发工具 dispatch-gates.mjs 新增「import 图」匹配键:改动落在 scripts/pm/** 下的某个模块时,所有直接或间接 import(含动态 import、再导出)它的门禁脚本所属的门禁族都会被派生出来,输出里打印从门禁脚本到该模块的整条 import 链。
  • 为什么改:PR fix(pm): the queue guard and governed register read paths with -z, so a non-ASCII or newline path stays governed #33804 第一版只改了 check-governed-queue-guard.mjs 和 check-governed-merges.mjs,--commands 派生 35 条、漏了 check:pm-fleet-write-execute(它的脚本 import 了被改的函数),开发者「35 条全绿」而 CI 红。现在同一组文件派生 62 条,含 fleet-write 的执行器、校验器和派发器。
  • 风险与回滚:只改 scripts/pm/** 下一个工具脚本和它的自测,不发布任何包。新键排在所有旧键之后,旧匹配的键与来源标签一字不变,只会多派、不会少派;代价是改大多数 pm 模块会多派约 40 多个门禁族(pm 工具互相 import 成一个大环,这是实测的真实影响面)。回滚即还原本 PR。
  • 先看:scripts/pm/dispatch-gates.mjs 的 loadEdgeTargets(读 import 边,含动态 import 的兜底)与 coveringKey 末尾的新分支;自测文件里 The import-graph key (#33848) 一节和改过的两条旧用例。
  • 两分钟验证:node scripts/pm/dispatch-gates.mjs --commands scripts/pm/check-governed-queue-guard.mjs scripts/pm/check-governed-merges.mjs | grep fleet-write,预期三行 pnpm check:pm-fleet-write-{dispatch,execute,validate}(修复前零行)。
  • 需要你做的:无,席位落地(非受管面)。

What changes

dispatch-gates --commands named a gate when a changed path was the gate's own script, a CI trigger, a job filter, a literal the gate spells, or a file it reads. It never named a gate because its script imports the changed module: coveringKey's docblock refused that key (#13126) on precision, because the shared heads under scripts/ (invoked-as.mjs and four others) are imported by most families. The pm tools are the opposite shape, and the measured miss is the card's: on PR #33804's first head the derivation named 35 gates, not check:pm-fleet-write-execute, whose script imports a changed function and whose self-test then went red in CI.

A new key, consulted last in coveringKey, answers a changed path under IMPORT_GRAPH_KEY_ROOT (scripts/pm/): a family matches when the path is in the transitive load closure of its gate files. Read from the module's side that is the reverse import graph over scripts/pm/**, at any depth. The row prints the chain, e.g. import graph scripts/pm/fleet-write/execute.mjs -> scripts/pm/check-governed-queue-guard.mjs. Outside scripts/pm/ the #13126 refusal stands unchanged (a self-test row pins that).

Piece What it does
loadEdgeTargets(path, source) One file's first-party load edges: static import … from, export … from (a re-export loads its target), the side-effect form, a dynamic import() of a string literal or of new URL(literal, import.meta.url). Comments are masked; a keyword inside a string or template literal is fixture text, not a load. Self-test bodies are not masked: a --self-test run loads them.
Unreadable dynamic import() The argument is a variable, a property or a computed URL. It is not dropped: every code-position module literal in that file becomes an edge, whether relative or spelled from the repo root under scripts/ (toward deriving more). Both shapes are live: a loader seam (load = (specifier) => import(specifier)) with its relative specifiers in a constant (ARM_READER_SOURCE), and a root-spelled roster loaded in process (fleet-write/dispatch.mjs's self-test imports each sender through pathToFileURL(join(REPO_ROOT, sender)); check-dispatch-gates.mjs loads its engine through import(resolve(ROOT, TOOL))). The root spelling also takes fixture rows and text reads written the same way (five modules check-governed-merges.mjs names as data); that over-derives, which is this key's direction.
importGraphReach(files, edgesOf) Breadth-first forward closure from a family's gate files, recording each module's first importer, so the printed chain is a shortest one. Walks self-test families and gate files too: the key claims what RUNNING the family loads, never what it watches, so neither population narrowing applies.
discoverFamilies Computes entry.importReach for every family, one scan per file per discovery.
derivationInputs Adds every reached module, since its edges decide what the key names.

Resolution is the existing first-party rule: relative specifiers only, inside scripts/, outside node_modules, the target must exist. A bare specifier is an installed package.

Measured on this tree (b8685e5), and printed by a self-test row on every run rather than recorded in prose: the key reaches 28 pm modules over 1195 (family, module) pairs, and the most-reached module, clause2-line.mjs, names 53 families. The pm tools close into one large cycle (the governed register, the half-state patrol, the queue guard and the dispatch-gates engine load one another), so an edit to most pm modules names forty-odd families. That is the measured size of what such an edit can break.

Time, measured on a quiet container, two cold runs each: a discovery took 16.6 s and 14.8 s before the key (base e71ecc1) and 17.2 s and 17.0 s with it (6f34ab1); a whole --commands run over one pm path took 36.0 s and 37.0 s before and 38.0 s and 35.7 s after. The review's 48.7 s was the same run on a loaded box. The stale "~14 s cold" in derivationInputs' docblock now carries these readings.

Tests

Full battery (node scripts/pm/dispatch-gates.mjs --self-test, both tiers) on b8685e5: 2530 cases pass (fast 2215 + slow 315), lock VERDICT command-exit 0. Round 1: 2528 passed on 80bc14b and on e6452d3.

New rows, all in the fast tier:

  • Fixture graph (in memory, so the shapes cannot rot with the tree): the reader takes the static import, the re-export, the side-effect form, a literal import() inside a self-test body and a new URL import; it refuses an import spelled in a template literal or a comment and a bare package; an unread import() widens to every module literal in the file, relative or root-spelled; CONTROL: the same two literals in a file with no unread import() are no edges.
  • ⭐ Transitive row: in the fixture, b.mjs reached only through gate.mjs -> a.mjs -> b.mjs names the family, and the row prints that chain.
  • Scope row: a module outside scripts/pm/ reached by import is still answered by no key.
  • ⭐ Root-spelled roster row (live tree, review M1): scripts/pm/issue-create.mjs, which no file under scripts/ imports statically and which the dispatcher's self-test loads by root path, derives check:pm-fleet-write-dispatch through the import graph.
  • Price row: prints the modules the key reaches, the (family, module) pairs and the most-reached module, asserting only that the key reaches anything.
  • ⭐ Replay row (live tree): PR fix(pm): the queue guard and governed register read paths with -z, so a non-ASCII or newline path stays governed #33804's first file list places check:pm-fleet-write-execute as matched via import graph scripts/pm/fleet-write/execute.mjs -> …, rendered pnpm check:pm-fleet-write-execute; and check:pm-fleet-write-validate and check:pm-fleet-write-dispatch match too.

Forced edits to existing rows (both are about the key order this PR extends):

  1. The [finding] dispatch-gates never names a family for an edit to a first-party module its gate script IMPORTS — 228 (family, module) pairs unreached, measured #13126 witness (the witness holds — bare-root-worklist --self-test imports THIS file, and no key names that family…) asserted the refusal's one known missing lead. That module is under scripts/pm/, so the new key names it; the row now asserts the edge exists AND the key that names it is the import-graph key (the witness is paid back — …). The other five refusal pins (novel class, worst head, concentration, the deferred-pair pins) are unchanged and green.
  2. Read-key additivity (every read edge earns a key, and none is re-attributed …) stripped entry.reads and compared against the keys left. The new key now sits after the read key, so with the reads stripped it answered those targets and the row reported 7 false re-attributions (program text read by … -> import graph …). The row now strips entry.importReach too, so it compares the read key against the keys consulted BEFORE it, which is its claim.
Ablation: the new branch in coveringKey disabled on disk, exactly the four key rows red, restored (head e6452d3)

Through node scripts/ablation-replace.mjs (anchor hits 1 -> 0 on disk, blob 7d65b7fe4962 -> 09197c9f6da0), the fast tier under os-verify-lock.sh; restore: blob == HEAD (7d65b7fe4962) and git diff HEAD empty.

mutation: the import-graph branch's condition prefixed with `false &&`
  -> VERDICT command-exit 1, 4 of 2213 failed:
  the witness is paid back — bare-root-worklist --self-test imports THIS file, and the import-graph key names that family for a card editing it
  the transitive row: a module reached only through an importer of an importer names the family, and the row prints the chain from the gate file
  the replay row: PR #33804's first file list derives check:pm-fleet-write-execute, through the import graph
  …and the validator and the dispatcher, the other two fleet-write families the card names
  (the edge-reader rows and the scope row stay green, as they must: they do not read the key)
Ablation, round 2 (review M1): the root-spelled half of the fallback disabled on disk, exactly two rows red, restored (head b8685e5)

Through node scripts/ablation-replace.mjs (anchor hits 1 -> 0, blob 8e00e6752a69 -> fcd7324b7a64), the fast tier under os-verify-lock.sh; restore: blob == HEAD (8e00e6752a69) and git diff HEAD empty.

mutation: a root-spelled literal in a file with an unreadable import() is skipped instead of admitted
  -> VERDICT command-exit 1, 2 of 2215 failed:
  an import() whose argument is not a literal widens toward MORE: every module literal in the file is an edge, relative or spelled from the repo root
  a sender the dispatcher loads by a root-spelled path derives check:pm-fleet-write-dispatch, through the import graph

Acceptance notes

Verification

Local subset on b8685e5 (round 2; main e71ecc1 merged in): node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 62 commands; 61 exit 0 and one exit 3 (each exit captured before any pipe). --ran with every line annotated :: exit N: 62 derived, 61 run, 1 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN. pnpm check:i18n-coverage is derived only through the import graph (its self-test imports the engine): its self-test half passed, its scan half refused with exit 3 because the CLI build closure is not built here; declared to CI. No package touched, so no build closure and no package test is owed.

The 62 commands and their exit codes
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run-card.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
node scripts/pm/board-snapshot.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/sweep-closed-cards.mjs --self-test :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closing-target-claim :: exit 0
pnpm check:commit-card-trailers :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:declared-population-live :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:i18n-coverage :: exit 3
pnpm check:issue-citations :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:partof-closing-keyword :: exit 0
pnpm check:pm-board-snapshot :: exit 0
pnpm check:pm-close-cards :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:pm-fleet-token :: exit 0
pnpm check:pm-fleet-write-dispatch :: exit 0
pnpm check:pm-fleet-write-execute :: exit 0
pnpm check:pm-fleet-write-validate :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-governed-prose :: exit 0
pnpm check:pm-half-states :: exit 0
pnpm check:pm-issue-create :: exit 0
pnpm check:pm-issue-transfer :: exit 0
pnpm check:pm-label-write :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:single-claim-paths :: exit 0
pnpm check:watch-hint-literal :: exit 0

Generated by Claude Code

…/pm module, transitively

WIP: the import-graph key and its self-test rows.

Claude-Session: https://claude.ai/code/session_01ADHkmRtrFmEsp5pAjTBpMT
Co-authored-by: Claude <noreply@anthropic.com>
… it; docblock prices the admission

Claude-Session: https://claude.ai/code/session_01ADHkmRtrFmEsp5pAjTBpMT
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 80bc14b0b0af5365e7fce7d13085a390829ab696
Local-runs: probe — one read-only node scripts/pm/dispatch-gates.mjs --commands scripts/pm/check-governed-queue-guard.mjs scripts/pm/check-governed-merges.mjs on this head in a temporary worktree (removed afterwards), to check the replay claim against the tool itself instead of the PR body
Scope: scripts/pm/dispatch-gates.mjs, scripts/pm/dispatch-gates.self-test.mjs + none

Inputs read: card #33848 body and its three comments (triage 6894767153, claim 6897694093, os-dev-report 6898826924); PR #34080 body, file list (2 files, +347 / -7) and net diff against main (merge base e71ecc1b); the check-runs on this head. Code outside the diff was read at this head to judge the diff, never reviewed.

Check-runs on the head at review time: every Lint lane (Lint · PM dispatch-gates, Lint · repo & tooling gates, Lint · scoped · tooling self-tests, Lint · CI, release & engine gates, Lint · docs & code guards, Lint · ESLint, both other scoped lanes, the Lint & Repo Gates aggregator), all four Type Check lanes, Check Changeset, Governed Surface Queue Guard, PR-body guards, Test Core (2/8) completed success. Still running: Test Core (1/8). The rest are skipped by their filters. PR mergeable_state reads blocked.

Findings: 1 must-fix, 2 should-fix, 4 nits.

① Derived judgments

Verified by reading the diff and the head:

  • Transitive. importGraphReach is a breadth-first forward closure from entry.files over loadEdgeTargets, with a seen set (cycles terminate) and a first-importer map; importGraphChain walks it back with its own cycle guard. Read from the changed module's side that is the reverse import graph at any depth. The changed path must be under scripts/pm/; the walk itself crosses all of scripts/, so a gate outside scripts/pm/ that imports into it, at any depth, is covered.
  • Edge forms. Static import … from and export … from (one shared regex), the side-effect form, a literal import() and import(new URL(literal, import.meta.url)) are each read; comments are masked, a keyword in a string or template literal is refused by the isCode test, self-test bodies are deliberately not masked. Each form has a fixture row.
  • Unreadable import() widens to every code-position relative module literal in the same file. Confirmed against the live seams: RECOGNISER_SOURCES (./record-recognisers.mjs, ./check-handover.mjs), ARM_READER_SOURCE, and loadGovernedRegister all keep relative literals in the importing file.
  • gitPathList reuse. The diff adds no git reader and no line-split reader at all; the replay row takes a literal two-path list. Nothing to restate.
  • Consulted last, additive. The new branch is the final statement of coveringKey, after the identity, trigger, job-filter, hint and read keys have each returned. It can only turn a null into a match; no earlier key's key or via can change. Additivity holds by construction.
  • Replay. Probe result on this head for PR fix(pm): the queue guard and governed register read paths with -z, so a non-ASCII or newline path stays governed #33804's first file list: 62 commands, exit 0, including pnpm check:pm-fleet-write-execute, pnpm check:pm-fleet-write-validate and pnpm check:pm-fleet-write-dispatch. The PR's number and its three lines are confirmed. Lint · PM dispatch-gates (which runs the replay row, the transitive row and the two edited rows) is green on this head.
  • Rows. Transitive row present (fixture gate.mjs → a.mjs → b.mjs, through the real coveringKey, chain asserted). Ablation-sensitive rows: the PR quotes exactly four rows red with the branch disabled; the ablated blob 7d65b7fe4962 is the blob of dispatch-gates.mjs at this head (the diff's index line reads 6343de57..7d65b7fe), so the ablation ran on the bytes under review even though it predates the merge of main. Not re-run here.
  • Forced edits, both forced and both named in the PR body. (1) The [finding] dispatch-gates never names a family for an edit to a first-party module its gate script IMPORTS — 228 (family, module) pairs unreached, measured #13126 witness asserted coveringKey(…) === null for a module under scripts/pm/ that bare-root-worklist.mjs imports; the new key necessarily answers it. (2) The read-key additivity row strips entry.reads and compares; with the new key placed after the read key, the stripped side is answered by the import graph, so the row must strip importReach too to keep comparing against the keys consulted before the read key. Neither edit weakens what the row claimed.

must-fix M1 — an unreadable import() whose target is spelled from the repo root is dropped, and that fails toward deriving LESS inside the dispatcher family the card names. The fallback takes relative literals only. The docblock and the PR body justify refusing root-spelled paths with a claim about the tree: that spelling is "a fixture row or a file a self-test reads as text", and a module loaded by root path "lives in spawned-child templates". Two in-process loads at this head contradict it:

  • scripts/pm/fleet-write/dispatch.mjs lines 4529 and 4567: the self-test's no-run conformance battery does await import(pathToFileURL(join(REPO_ROOT, sender)).href) for every sender it discovers, and names its floor as code-position root-spelled literals (KNOWN: scripts/pm/close-cards.mjs, issue-create.mjs, issue-transfer.mjs, label-write.mjs, post-stamped.mjs, rerun-failed.mjs). It then calls each sender's exported relay-miss probe.
  • scripts/pm/check-dispatch-gates.mjs line 595: await import(resolve(ROOT, TOOL)) with TOOL = 'scripts/pm/dispatch-gates.mjs'.

Consequence for the first: close-cards.mjs, issue-create.mjs and issue-transfer.mjs have no static importer anywhere under scripts/, so no import chain reaches them from check:pm-fleet-write-dispatch; the literals sit inside selfTest(), which the hint scan masks; dispatch.mjs carries no dispatch-gates: declaration; and the family runs unconditionally in CI. So a card editing one of those senders can redden the dispatcher's self-test in CI without that family being derived, which is the card's defect (a self-test that loads a changed scripts/pm module) in the family the card's own acceptance line names. This is read from the code, not measured: the one probe was spent on the replay. Required: either take code-position root-spelled first-party module literals as edges when a file has an unread import() (the cost the PR measured is five extra modules for check-governed-merges.mjs, which is the side this tool is supposed to err on), or show with a live-tree row that an edit to scripts/pm/issue-create.mjs places check:pm-fleet-write-dispatch; and correct the sentence in the docblock and the PR body either way. The fixture row that pins "a root-spelled path is not" an edge moves with it.

should-fix S1 — the reach is seeded from entry.files only, so the import closure of a program a family spawns is not walked. The PR discloses that a spawned child is not an import edge and says the run key answers it "where it applies". It does not for this card's class: the spawn follow sits below if (entry.selfTest) continue, and it contributes population hints, never the child's path or the child's imports. Live shape: check:pm-dispatch-gates runs check-dispatch-gates.mjs, which spawns dispatch-gates.mjs --self-test; that family is derived for the replay paths (probe), through an earlier key, so no live miss is shown. Carrier if not fixed here: a follow-up card on scripts/pm/dispatch-gates.mjs, serial after #34002.

should-fix S2 — the wall-clock price is not stated. Discovery now scans every reached file once more (scanSource over files of 17k and 33k lines). The probe took 48.7 s wall for one --commands run in this container; the derivationInputs docblock quotes about 14 s cold for a discovery. I have no before-number and did not take one. State the before and after for one cold --commands run in the PR body.

Not covered, checked, no live instance found (nits):

  • N1 createRequire / require('./x'): not read. No first-party relative require under scripts/pm/ at this head (the three hits are child-source strings requiring builtins or packages).
  • N2 A template-literal specifier with an interpolation is counted as unread (so the file widens) but names nothing itself; a specifier table kept in a different file than the import() is not followed; a from followed by a newline before the specifier is missed by the inherited regex. No live instance of any of the three under scripts/.
  • N3 The transitive evidence is fixture-only: both live replay chains are one level deep (execute.mjs imports check-governed-queue-guard.mjs directly, validate.mjs imports check-governed-merges.mjs directly).
  • N4 The measured figures (24 modules, 1003 pairs, about 42 families, 52 for clause2-line.mjs) and the "266 of 443" in the derivationInputs docblock are pinned by no row and will drift; not re-measured here.

② Semver level

No published package is touched: both files are under scripts/pm/. skip-changeset is on the PR and Check Changeset is green on the head. Clause-②: no is on the PR body and on the claim, and is right: no schema, no published surface, no narrowing of a declared capability. Metadata-protocol: none is right. No semver level is owed.

③ Boundary flags

  • File surface. The diff is exactly the two claimed files. No breach.
  • Deviation 1 (an ablation on a script). Accepted as a one-off on disk with the restore evidence quoted (blob equals HEAD, empty git diff HEAD). Whether the order asked for it is the seat's to confirm; I did not read the order.
  • Deviation 2 (ablation on e6452d31, before main was merged). Answered above: the ablated blob is this head's blob. Accepted.
  • Deviation 3 (pnpm check:i18n-coverage exit 3 locally). The dev's reading is right. The script is --self-test && scan, so an exit 3 from the pair means the self-test half exited 0; 3 is EXIT_PREREQUISITE_NOT_MET (the CLI build closure was absent), not a finding. The family is derived only because its self-test imports the engine (import('./pm/dispatch-gates.mjs'), line 1475), and that half ran. CI covers the scan half: the step Check no new untranslated declared labels in Type Check · consumer gates runs pnpm check:i18n-coverage after the build, and it concluded success on this head.
  • Open question (cost: most pm edits now name about 42 families, 62 commands). Answer: A, keep it transitive, unbounded. Options B (one level) and C (a fan-in cap) both cut real load chains and so fail toward deriving LESS, which is the defect being fixed; the list is run through --commands and reconciled by --ran, not read by eye, and each added row prints its chain. If the volume is to come down, the place is the load cycle among the pm modules, not the key. Not escalated; S2 asks for the wall-clock half of the price.
  • Out-of-scope finding (check:adr-anchors under-declares its population). Escalated to the seat: the dev filed it with carrier: none, and a note in a PR body is not a carrier. Suggested carrier: one new finding card, filing gate ①, domain:skills, on scripts/check-adr-anchors.mjs (declare the whole-tree population its scan reads), citing PR pm: the low-risk arm lands an add-only ADR note as Tier S; any other ADR change stays H #33975 as the measurement. Read here only as far as this: that script carries no dispatch-gates: declaration at this head; the five-hint count is the dev's and was not re-derived.
  • Serial note (pm(dispatch-gates): triggerPatternRegex's ** does not span a path segment that holds a newline (no dotAll), so a pattern-judged gate is silently not derived #34002, same file). Held, not folded in. Correct.

④ Design judgment

scripts/pm/dispatch-gates.mjs — the design holds against the card's scenario: scoping the key to scripts/pm/ keeps the #13126 refusal where its price was measured, placing it last makes it additive without a row having to argue it, and printing the chain makes each added lead checkable. The load-edge reader is a separate function from firstPartyImportBindings for a stated reason (a population question against a load question) and reuses its regexes and its resolution rule. Where it does not hold is M1: the one place the reader narrows (root-spelled literals under an unread import()) rests on a statement about the tree that the tree contradicts, in the family the card names.

scripts/pm/dispatch-gates.self-test.mjs — the rows agree with the code they pin, and the two forced edits keep their rows' claims. The row asserting that a root-spelled path is not an edge pins the behaviour M1 asks to change.

Implemented-by: claude/project-thread-8x8llj
Reviewed-by: session_01ADHkmPd7uRqHauEehGPr19

VERDICT: FAIL

…terals in its file

Claude-Session: https://claude.ai/code/session_01ADHkmRtrFmEsp5pAjTBpMT
Co-authored-by: Claude <noreply@anthropic.com>
…efore and after the import-graph key

Claude-Session: https://claude.ai/code/session_01ADHkmRtrFmEsp5pAjTBpMT
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b8685e50db4d8da9e5b10e9737d6547c71c62735
Local-runs: none
Scope: scripts/pm/dispatch-gates.mjs, scripts/pm/dispatch-gates.self-test.mjs + none

Delta round against the FAIL record 6898932707 on 80bc14b0. Inputs read: the delta 80bc14b0..b8685e50 (two commits, 6f34ab17 and b8685e50, no merge; the same two files, +64 / -19), the net diff against main (merge base e71ecc1b, 2 files, +395 / -10), the current PR body, the round-2 os-dev-report 6899446197 on card #33848, and the check-runs on this head. No local run: the new live row is executed by Lint · PM dispatch-gates, which is green on this head, so the probe was not needed.

Check-runs on the head: nothing is still running. Every Lint lane (Lint · PM dispatch-gates, Lint · repo & tooling gates, Lint · scoped · tooling self-tests, the other five and the Lint & Repo Gates aggregator), all four Type Check lanes, Governed Surface Queue Guard, PR-body guards (both runs), Test Core and Test UI completed success. Check Changeset is skipped on this head (the skip-changeset label is on the PR). mergeable_state reads clean.

Findings on this head: 0 must-fix, 0 should-fix, 4 nits.

① Derived judgments

M1 — closed. The fallback under an unreadable import() now also admits a code-position module literal spelled from the repo root under scripts/: LOAD_MODULE_LITERAL gains the scripts/ alternative and the loop sends such a literal to admit directly. The docblock sentence that the tree contradicted is replaced by one naming both in-process sites I cited (fleet-write/dispatch.mjs's sender roster, check-dispatch-gates.mjs's import(resolve(ROOT, TOOL))), and it states the over-derivation it accepts (the five modules check-governed-merges.mjs names as data). The PR body carries the same correction. A live-tree row pins scripts/pm/issue-create.mjs placing check:pm-fleet-write-dispatch with a via that starts import graph; the fixture widen row now expects both spellings and its CONTROL carries both literals in a file with no unread import(). The dev reports an ablation of the root-spelled admission turning exactly those two rows red of 2215; not re-run here, and the lane that runs both rows is green on this head.

The admission cannot narrow, and it fails toward more. Checked by reading:

  • The regex change is a pure alternation added in front of the same tail. A literal that matched before starts with ./ or ../ and still matches the first alternative; a root-spelled match contains no quote character, so it cannot swallow the opening of a relative literal that matched before.
  • The only new statement is an admit call, which adds to the target set under the same guards as before (inside scripts/, outside node_modules, not the file itself, target exists). Nothing is removed from any file's targets.
  • So every family's importReach is a superset of what it was on 80bc14b0, and the key that reads it is still the last statement of coveringKey: every pair an earlier key answered keeps its key and label, every pair the import graph answered before is still answered, and derivationInputs only grows.
  • A file with no unread import() is untouched (the CONTROL row pins it), so the widening stays confined to files whose load set the scan already admits it cannot read.

S2 — closed. The derivationInputs docblock and the PR body now state two cold readings each side: a discovery 16.6 s and 14.8 s before against 17.2 s and 17.0 s after; a whole --commands run 36.0 s and 37.0 s before against 38.0 s and 35.7 s after, with my 48.7 s named as a loaded-box reading. The dev's numbers, not re-measured; the delta they show is within their own run-to-run spread, which is an acceptable price.

S1 — closed by carrier. The spawned-child closure is carried by #34084 (open, domain:skills, priority:p3, pm:queue, titled for exactly this gap), and the PR body's not-covered note now names the closure rather than only the spawned file and cites that carrier. I agree with carrying it: no live miss was shown in round 1, and the root-spelled admission incidentally closes the one live instance I named, since check-dispatch-gates.mjs now reaches dispatch-gates.mjs and its closure through its own unread import().

Round-1 nits: N4 is closed (a self-test row prints modules reached, pairs and the most-reached module on every run; the report reads 28 modules, 1195 pairs, 53 families for clause2-line.mjs, up from 24 / 1003 / 52, which is the root-spelled widening and the expected direction). N1, N2 and N3 stand as nits. New nits:

  • N5 The docblock line under the fallback still reads "Resolution is … relative specifiers only"; with the root spelling admitted that sentence is one clause short.
  • N6 The root-spelled admission reads whole literals only. A path assembled from segments (join(ROOT, 'scripts', 'pm', 'x.mjs')), or a sender the dispatcher's battery discovers at run time that is not in its KNOWN floor, is still named by nothing. No live instance of the first; the second is a new file's first card. pm(dispatch-gates): the import-graph reach does not start from child scripts a gate spawns #34084 is a reasonable place to note both.
  • N7 The round-2 report's line_budget still reads +347 / -7; the net diff is +395 / -10. No ratcheted surface is touched either way.

② Semver level

Unchanged from round 1. Both files are under scripts/pm/, no published package is touched, skip-changeset is on the PR, Clause-②: no and Metadata-protocol: none are on the body and are right. No semver level is owed.

③ Boundary flags

④ Design judgment

scripts/pm/dispatch-gates.mjs — the one narrowing that rested on a false statement about the tree is gone, and the reader now errs toward more at every point where it cannot read a load: static and literal edges are read, an unreadable import() takes every first-party module literal the file spells. What remains uncovered (spawned-child closures, segment-assembled paths, require) is named, has no shown live miss, and has a carrier. The design holds against the card's scenario and against the dispatcher case round 1 raised.

scripts/pm/dispatch-gates.self-test.mjs — the row that pinned the old behaviour is rewritten to pin the new one together with its control, and the live sender row asserts the family, the verdict and the key that carried it. The price row asserts only non-emptiness and prints the rest, which is the right shape for a number that moves with the tree.

Implemented-by: claude/project-thread-8x8llj
Reviewed-by: session_01ADHkmPd7uRqHauEehGPr19

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19

席位核对 · ACCEPT · head b8685e50db4d8da9e5b10e9737d6547c71c62735 · 2026-11-15T18:51Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 18:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit e9b44ab Nov 15, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-8x8llj branch November 15, 2026 22:33
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…dispatch-gates derives it for every card (objectstack-ai#34114)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi92Vt19B5bTPa1d6K7Nf4xkL)_

Fixes objectstack-ai#34086

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:门禁 `check:adr-anchors` 在源码里声明「我读整棵树」(dispatch-gates 现有的
whole-tree-population 标记),派发工具 `dispatch-gates` 同步认得 `git grep`
这种全树读法;从此每张卡的 `--commands` 都会派出这个门禁。
- 为什么改:这个门禁用 `git grep` 扫全仓所有文本文件里的 `ADR-NNNN` 引用,却只声明了 4
个路径;改它们之外的文件时派发清单不点它,开发者本地全绿、CI 才红(PR objectstack-ai#33975 就是一个 `scripts/pm/`
脚本里的测试字符串触发的)。
- 风险与回滚:只改三个工具脚本,不发布任何包。每张卡多派一条命令,实测约 11 秒。dispatch-gates
只在识别清单末尾追加一条,原有三条及其下标不动。回滚即还原本 PR。
- 先看:`scripts/check-adr-anchors.mjs` 的 `collectCitations` 上方新标记行与自测
`live-scan-population-is-declared`;`scripts/pm/dispatch-gates.mjs` 的
`REPO_ROOT_WALK_SPELLINGS` 第四条。
- 两分钟验证:`node scripts/pm/dispatch-gates.mjs --commands
scripts/pm/check-governed-merges.mjs | grep adr-anchors`,预期一行 `pnpm
check:adr-anchors`(修复前零行)。
- 需要你做的:无,席位落地(非受管面)。

## What changes

`check:adr-anchors`' third check (objectstack-ai#6634) collects citations with `git
grep --untracked -IonE …` and no pathspec, so it reads every tracked and
every untracked-not-ignored text file. Its source spelled only four path
literals (`docs/adr`, its own script and the two release-owned
`CHANGELOG.md` files on its excuse list), so `dispatch-gates` placed the
family by those alone and scored it `silent` for any other file.
Measured on main f81e4b6: 10,237 tracked files cite an ADR, 10,078 of
them outside those literals; `--commands
scripts/pm/check-governed-merges.mjs` derived 33 commands and not this
one.

**Route: declare, don't narrow.** The whole-tree read is the point of
the check (a citation nobody resolves rots wherever it is written), so
the scan stays as it is. `wide-population` was also rejected: it keeps a
family out of `--commands`, which is the opposite of the acceptance and
of "a miss fails toward deriving more". The existing
`whole-tree-population` marker (the channel `check:nul-bytes` and seven
other families use) is the fit. No new declaration grammar.

| File | Change |
|:--|:--|
| `scripts/check-adr-anchors.mjs` | The `// dispatch-gates:
whole-tree-population -- …` line above `collectCitations`, with a note
on why the scan is not narrowed. A live self-test case,
`live-scan-population-is-declared`, holds the marker to the scan in both
directions: a scan reading more than one top-level root needs the
marker, and a marker over a one-root scan is red too. The live battery's
floor moves 21 → 22 for that case. |
| `scripts/pm/dispatch-gates.mjs` | `REPO_ROOT_WALK_SPELLINGS` gains
limb D, `a \`git grep\` search of the tracked corpus`, appended after
limbs 0–2 (unchanged). Without it the marker was REFUSED ("its own
source carries no recognised repo-root walk … EXTEND
REPO_ROOT_WALK_SPELLINGS"). The regex is held to the execFile shape
(`'git'` then an argv array holding `'grep'`), so the system
`spawnSync('grep', …)` over one named file in
`check-skill-compatibility-version.mjs` does not match. Out of the
card's file surface: declared to the seat before the edit and approved,
with the claim's surface amended. |
| `scripts/pm/dispatch-gates.self-test.mjs` | Two fixture cases beside
limbs A–C: limb D reads the execFile `git grep`; the system grep is not
a walk. |

## Tests

- `node scripts/check-adr-anchors.mjs --self-test`: 134 assertions pass,
floor included.
- `pnpm check:pm-dispatch-gates` (fast tier): 2207 cases pass, 335 s.
- Acceptance, before and after: on f81e4b6 `node
scripts/pm/dispatch-gates.mjs --commands
scripts/pm/check-governed-merges.mjs` printed 33 lines, 0 naming
`check:adr-anchors`; on a6876cc it prints 34, including `pnpm
check:adr-anchors`, placed under "Always runs (declared population)"
with the marker's reason. The always-runs block grows 8 → 9 families.
- No forced edits to existing test rows.

## Acceptance notes

- Price: every card's `--commands` now carries `pnpm check:adr-anchors`
(self-test plus scan, about 11 s measured here).
- Serial: PR objectstack-ai#34080 (in the merge queue) and card objectstack-ai#34084 also edit
`scripts/pm/dispatch-gates.mjs`, in other regions; whichever lands
second resolves.
- The claim's acceptance line asks for `check-governed-merges.mjs --pr`
and the tier; the reading is in the os-dev-report on the card.

## Verification

Local gates on a6876cc (main f81e4b6 is the base): `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 33 commands; all 33 exit 0. `--ran`:
**33 derived, 33 run, 0 NOT-MEASURED, 0 UNRUN**. No package touched, so
no build closure and no package test is owed; no changeset
(`skip-changeset`).

<details><summary>The 33 commands and their exit codes</summary>

```text
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:declared-population-live :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:watch-hint-literal :: exit 0
```

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmT9YphoBfbtPDaBJrs)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm(dispatch-gates): --commands does not derive the self-test of a script that imports a changed scripts/pm module

2 participants